package cn.qihua.action;

import java.util.List;

import org.apache.struts2.json.annotations.JSON;

import cn.qihua.model.LogProduct;
import cn.qihua.service.ILogService;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author 米修
 * 
 */

public class ListLogProductAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7536863222803216311L;
	public String message;
	private boolean success = false;
	private ILogService logService;
	private List<LogProduct> listLogProduct;
	private int query;

	public String listLogProduct() {
		listLogProduct = logService.findLogProductByProductId(query);
		if (listLogProduct != null && listLogProduct.size() > 0) {
			this.setSuccess(true);
			return SUCCESS;
		}
		this.setSuccess(false);
		return SUCCESS;
	}

	@JSON(name = "root")
	public List<LogProduct> getListLogProduct() {
		return listLogProduct;
	}

	public void setListLogProduct(List<LogProduct> listLogProduct) {
		this.listLogProduct = listLogProduct;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public int getQuery() {
		return query;
	}

	public void setQuery(int query) {
		this.query = query;
	}

	public void setLogService(ILogService logService) {
		this.logService = logService;
	}
}
